<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>销售订单编辑</title>
<link href="/resources/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="/resources/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="/resources/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/resources/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
<script src="/resources/lib/jquery-validation/jquery.validate.min.js" type="text/javascript"></script> 
<script src="/resources/lib/jquery-validation/jquery.metadata.js" type="text/javascript"></script>
<script src="/resources/lib/jquery-validation/messages_cn.js" type="text/javascript"></script>
<script src="/resources/lib/json2.js" type="text/javascript"></script>
<script src="/resources/js/jsF7.js" type="text/javascript"></script>
<script src="/resources/js/selectData.js" type="text/javascript"></script>
<script src="/resources/js/themis.js" type="text/javascript"></script>
<script src="/resources/js/validation.js" type="text/javascript"></script>
<script src="/resources/js/Lodop6.145/LodopFuncs.js" type="text/javascript" ></script>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed>
</object> 
<script type="text/javascript">
	var form1;
	var form2;
	var grid;
	$(function(){
	    //工具条
	    $("#toptoolbar_menu").ligerToolBar({ items: [
	        	{ text: '保存', id:'save',click: saveForm,icon: 'save' },
	        	{ text: '提交', id:'save',click: submitForm },
	        	{ text: '审核', id:'save',click: auditForm },
	        	{ text: '反审核', id:'save',click: unAuditForm},
	        	{ text: '收款', id:'receipt',click: receipt},
	        	{ text: '附件', id:'formfile',click: formfile},
	        	{ text: '打印', id:'print',click: print}
	    	]
	    });
        //创建表单(头部)
        form1 = $("#form1").ligerForm({
        inputWidth: 170, labelWidth: 90, space: 40,
        validate:true,
        fields: [
				{ display: "单据编号 ", name: "number", type: "text",newline: false, validate: { required: true, minlength: 5 } },
				{ display: "合同签订日期", name: "bizDate", type: "date",newline: false, validate: { required: true, minlength: 5 } },
	            { display: "销售部门", name: "depGroup.uuid", newline: false, type: "popup",textField:'depGroup.name',
	            	 editor: {
	                    grid: getDepGroupGrid(true),
	                    valueField:'uuid',
	                    textField: 'name',
	                    parms :{date:new Date().getTime()},
	                    width: 300,
	                    height:100,
	                    realTimeLoad:true
	           	 }
	           },
				
				{ display: "交货日期", name: "deliveryDate", newline: false,  type: "date" },
				{ display: "销售类型", name: "deliveryWay",newline: false,  type: "select",editor: {data:getDeliveryWaySelect()}},
	            { display: "客户", name: "customer.uuid", newline: false, type: "popup",textField:'customer.name',
	            	 editor: {
	                    grid: getCustomerGrid(true),
	                    valueField:'uuid',
	                    textField: 'name',
	                    parms :{date:new Date().getTime()},
	                    width: 300,
	                    height:100,
	                    realTimeLoad:true
	           	 }
	           },
	           { display: "销售员", name: "salePerson.uuid", type: 'popup',newline: false,textField: 'salePerson.trueName',
	             	 editor: {
	                      grid: getSysUserGrid(true),
	                      valueField:'uuid',
	                      textField: 'trueName',
	                      parms :{date:new Date().getTime()},
	                      width: 300,
	                      height:100,
	                      realTimeLoad:true
	             	 }
	             },
				{ display: '累计收款金额', name: 'sumReceiptAmount',editor: { type: 'float' }},
				{ display: "备注", name: "remark", newline: true, type: "text", width: 470}
            ]
        });
        
        //创建分录
        grid = $("#grid").ligerGrid({
            columns: [
					  { display: '商品编码', name: 'material.uuid', type: 'popup', width: 100,textField:'material.number',
						  	editor: {type: 'popup',
						     grid: getMaterialGrid(true),
						     valueField: 'uuid',
						     textField: 'number',
						     parms :{date:new Date().getTime()},
						     width: 300,
						     height:100,
						     realTimeLoad:true,
						     onSelected:function(e){
						    	var ec =  grid.curEditColumn;
						    	grid.updateCell('materialName', e.data[0].name, ec.rowData);
						    	grid.updateCell('materialStandard', e.data[0].standard, ec.rowData);
						    	grid.updateCell('jilUnit.uuid', e.data[0].baseUnit, ec.rowData);
						   	 // console.log(e);
						     }
						  }
					   },
					  { display: '商品名称', name: 'materialName', width: 100, type: 'text'},
					  { display: '商品规格型号', name: 'materialStandard', width: 100, type: 'text'},
/* 					  { display: '计量单位', name: 'jilUnit', width: 100, editor: { type: 'text' }},
 */					  
					  { display: "计量单位", name: "jilUnit.uuid", width: 100,newline: false, type: "popup",textField:"jilUnit.name",
	             	   editor: {
	             		  		//type: 'popup',
		                       grid: getBaseUnitMeasureGrid(true),
		                       valueField:'uuid',
		                       textField: 'name',
		                       parms :{date:new Date().getTime()},
		                       width: 300,
		                       height:100,
		                       realTimeLoad:true
		              	 }   
	                   },
	                   { display: '销售数量', name: 'saleQty', width: 100, type: 'float', editor: { type: 'float',
	       	        	onChangeValue:function(value){
	       	        		var ec =  grid.curEditColumn;
	       	        		if(!isNaN(value)&&ec.rowData.conversionRate){
	            	        		grid.updateCell('fsaleQty', formatCurrency(value/ec.rowData.conversionRate), ec.rowData);
	            	        		grid.updateTotalSummary();
	       	        		}
	       	        	}	
	       	        },render:function(item){
	       	        	return formatCurrency(item.saleQty);
	       	        },totalSummary:{type: 'sum'}},
	       	        
					//{ display: "辅助计量单位", name: "fjilUnit.uuid", width: 100,newline: false, type: "popup",textField:"fjilUnit.baseUnitMeasure.name",
	              	//  editor: {				  
	              	//	  		type: 'popup',
	 	            //          grid: getfUnitMeasureGrid(true),
	 	            //          valueField:'uuid',
	 	            //          textField: 'baseUnitMeasure.name',
	 	            //            //
	 	            //           width: 300,
	 	            //           height:100,
	 	            //           realTimeLoad:true,
	 	            //         onButtonClick:function(){
	 	            //        	 var uuid= null;
	 	            //        	  try{
	 	            //        		 uuid =  grid.curEditColumn.rowData.material.uuid;
	 	            //        	  }catch(e){
	 	            //        		 uuid = null;
	 	            //        	  }
	 	            //        	if(uuid){
	 	            //        		this.options.parms = {materialId:uuid};
	 	            //        	}
		            //           },
		            //           onSelected:function(e){
		            //           	var ec =  grid.curEditColumn;
		            //           	if(e.data[0]){
		            //           		grid.updateCell('conversionRate', e.data[0].conversionRate, ec.rowData);
		            //          		grid.updateCell('forderQty', ec.rowData.orderQty/e.data[0].conversionRate, ec.rowData);
		            //           		grid.updateTotalSummary();
		            //           	}
		   			//	    	//grid.updateCell('jilUnit.uuid', e.data[0].baseUnit, ec.rowData);
		            //            }
	 	            //  	 }   
	 	            // },
	 	            //{ display: '辅助换算率', name: 'conversionRate', width: 100, type: 'float'},
	     	        //{ display: '辅助数量', name: 'forderQty', width: 100, type: 'float', editor: { type: 'float' ,
	     	        //	onChangeValue:function(value){
	     	        // 		var ec =  grid.curEditColumn;
	     	        //		if(!isNaN(value)&&ec.rowData.conversionRate){
	         	    //    		grid.updateCell('orderQty', formatCurrency(value*ec.rowData.conversionRate), ec.rowData);
	         	    //    		grid.updateTotalSummary();
	     	        //		}
	    	        //	}		
	     	        //},render:function(item){
	    	        //	return formatCurrency(item.forderQty);
	    	        //},totalSummary:{type: 'sum'}},
					 
					  { display: '含税单价', name: 'taxPrice', width: 100, editor: { type: 'float' }},
					  { display: '单价', name: 'price', width: 100, editor: { type: 'float' }},
					  { display: '进项税率%', name: 'incomeRate', width: 100, editor: { type: 'float' }},
					  { display: '折扣率', name: 'discountRate', width: 100, editor: { type: 'float' }},
					  { display: '折扣额', name: 'discountLimit', width: 100, type: 'float' },
					  { display: '税额', name: 'taxLimit', width: 100, type: 'float'},
					  { display: '不含税额', name: 'notTaxLimit', width: 100, type: 'float'},
					  { display: '价税合计', name: 'taxAmount', width: 100, type: 'float',totalSummary:{type: 'sum'}},
					  { display: '累计发运数量', name: 'sumDispQty', width: 100, type: 'float'},
					  { display: '累计出库数量', name: 'sumOutQty', width: 100, type: 'float'},
					  { display: '备注', name: 'remark', width: 100, editor: { type: 'text' }},
		    	      { display: 'uuid',name: 'uuid',hide:true, width: 100, type: 'text' }

            ], usePager: false,width: '95%',height: '275px',enabledEdit: true,alternatingRow:true,
            checkbox: true,headerRowHeight:22, rowHeight:22, rownumbers:true,
            onAfterEdit: f_onAfterEdit,

            toolbar: { items: [
                               { text: '添加行', click: addNewRow,icon: 'add' },
                               { line: true },
                               { text: '删除行', click: delRow,icon: 'delete' }
                               ]
                     }
            
        });
        //创建表单(尾部)
        form2 = $("#form2").ligerForm({
        inputWidth: 170, labelWidth: 90, space: 40,
        validate:true,
        fields: [
            
            { display: "创建人", name: "createUser.uuid", type: 'popup',newline: false,textField: 'createUser.trueName',
            	 editor: {
                     grid: getSysUserGrid(true),
                     valueField:'uuid',
                     textField: 'trueName',
                     parms :{date:new Date().getTime()},
                     width: 300,
                     height:100,
                     realTimeLoad:true
            	 }
            },
            { display: "修改人", name: "alterUser.uuid", type: 'popup',newline: false,textField:'alterUser.trueName',
           	 editor: {
                    grid: getSysUserGrid(true),
                    valueField:'uuid',
                    textField: 'trueName',
                    parms :{date:new Date().getTime()},
                    width: 300,
                    height:100,
                    realTimeLoad:true
           	 }
           },
            { display: "审核人", name: "auditUser.uuid", type: 'popup',newline: false,textField:'auditUser.trueName',
              	 editor: {
                       grid: getSysUserGrid(true),
                       valueField:'uuid',
                       textField: 'trueName',
                       parms :{date:new Date().getTime()},
                       width: 300,
                       height:100,
                       realTimeLoad:true
              	 }
              },
            
            { display: "创建日期", name: "createDate", newline: false, type: "date"},
            { display: "修改日期", name: "alterDate", newline: false,  type: "date" },
            { display: "审核日期", name: "auditDate",newline: false, type: "date" },
            { display: "提交人", name: "submitUser.uuid", type: 'popup',newline: false,textField:'submitUser.trueName',
             	 editor: {
                      grid: getSysUserGrid(true),
                      valueField:'uuid',
                      textField: 'trueName',
                      parms :{date:new Date().getTime()},
                      width: 300,
                      height:100,
                      realTimeLoad:true/* ,
                      onSelected:function(e){
                    	  var edd = form2.getEditor("createUser.uuid"); //form中应用
                    	  edd.setText(e.text);
                    	  console.log(e);
                      } */
             	 }
             },
            { display: "提交日期", name: "submitDate",newline: false, type: "date" },
            { name: "uuid", type: "hidden" },
            { display: "单据状态", name: "status", newline: false, type: "select",editor: {data:getStatsSelect()} }
            ]
        });
      	var info = '${info}';
    	if( info != null && info != ""){
    		var infoData = JSON.parse(info);
    		console.log(infoData);
    		form2.setData(infoData);
    		form1.setData(infoData);
    		grid.set({ data: {Rows:infoData.entrys}}); 
    	}
    	//单据状态
   		setEditStatus('${editStatus}',form1,form2,grid);
        //设置不可编辑字段
        form1.setEnabled(["sumReceiptAmount"],false);
   		form2.setAllEnabled(false);
	});
	
	 //编辑后事件 
	function f_onAfterEdit(e){
		 //单价=含税单价/（1+税率）
		grid.updateCell('price', e.record.taxPrice * (1 + e.record.incomeRate/100), e.record); 
		 //折扣额=数量*含税单价*折扣率
		grid.updateCell('discountLimit', e.record.saleQty * e.record.taxPrice * (e.record.discountRate/100), e.record); 
		 //价税合计=数量*含税单价-折扣额
		grid.updateCell('taxAmount', e.record.saleQty * e.record.taxPrice - e.record.discountLimit, e.record); 
		//不含税额=价税合计/(1+税率)-折扣额
		grid.updateCell('notTaxLimit', e.record.taxAmount/(1 + e.record.incomeRate/100), e.record); 
	     //税额=价税合计-不含税
		grid.updateCell('taxLimit', e.record.taxAmount-e.record.notTaxLimit, e.record); 
	}
	 function formatCurrency(num)
     {
         if (!num) return "0.00";
         num = num.toString().replace(/\$|\,/g, '');
         if (isNaN(num))
             num = "0.00";
         sign = (num == (num = Math.abs(num)));
         num = Math.floor(num * 100 + 0.50000000001);
         cents = num % 100;
         num = Math.floor(num / 100).toString();
         if (cents < 10)
             cents = "0" + cents;
        /*  for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
             num = num.substring(0, num.length - (4 * i + 3)) + ',' +
     num.substring(num.length - (4 * i + 3)); */
     
         return (((sign) ? '' : '-') + '' + num + '.' + cents);
     }
	
</script>
</head>
<body>
  <div style="display: none;"></div>
  <div id="toptoolbar_menu">333</div>
  <form id="form1"></form>
  <div id="grid" style="margin-top:15x"></div>
  <form id="form2" style="margin-top:15px"></form>
</body>
<script type="text/javascript">
//添加分录
function addNewRow(){
	grid.addRow({ 
		saleQty:0,
		taxPrice:0.00,
		price:0.00,
		incomeRate:17,
		discountRate:0.00,
		discountLimit:0.00,
		taxLimit:0.00,
		notTaxLimit:0.00,
		taxAmount:0.00,
		sumDispQty:0,
		sumOutQty:0
    });
}
//删除分录
function delRow(){
	grid.deleteSelectedRow();
}
//保存
function saveForm(){
    if(form1.valid()){
		var delData = grid.getDeleted();
		var gridData = grid.getData();
		var form1Data = form1.getData();
		var form2Data = form2.getData();
		if(validationSave($.ligerDialog,form2Data.status)){
			return;
		};
		var formData = $.extend({}, form1Data,form2Data);
		formData.entrys = gridData;
		$.ajax({
	        loading: '正在保存数据中...',
	        type:'post',
	        url: "/saleOrder/saveOrUpdateSaleOrder",
			dataType:'json',
	        data: {formData:JSON.stringify(formData),delData:JSON.stringify(delData),gridData:JSON.stringify(gridData)},
	        success: function (data) {
					$.ligerDialog.success(data.message,'信息',function(){
						form2.setData(data.data);
				    });
	        },
	        error: function (message) {
	       	 	$.ligerDialog.error("保存失败");
	        }
	    });
    }
}
//提交
function submitForm(){
	var info = form2.getData();
	if(validationSubmit($.ligerDialog,info.status)){
		return;
	};
	$.ajax({
        loading: '正在保存数据中...',
        type:'post',
        url: "/saleOrder/submitSaleOrder",
		dataType:'json',
        data: {uuid:info.uuid},
        success: function (data) {
				$.ligerDialog.success(data.message,'信息',function(){
		    		form2.setData(data.data);
			    });
        },
        error: function (message) {
       	 	$.ligerDialog.error("提交失败");
        }
    });
}
//审核
function auditForm(){
	var info = form2.getData();
	if(validationAudit($.ligerDialog,info.status)){
		return;
	};
	$.ajax({
        loading: '正在审核数据中...',
        type:'post',
        url: "/saleOrder/auditSaleOrder",
		dataType:'json',
        data: {uuid:info.uuid},
        success: function (data) {
				$.ligerDialog.success(data.message,'信息',function(){
		    		form2.setData(data.data);
			    });
        },
        error: function (message) {
       	 	$.ligerDialog.error("审核失败");
        }
    });
}
//反审核
function unAuditForm(){
	var info = form2.getData();
	if(validationUnAudit($.ligerDialog,info.status)){
		return;
	};
	$.ajax({
        loading: '正在反审核数据中...',
        type:'post',
        url: "/saleOrder/unAuditSaleOrder",
		dataType:'json',
        data: {uuid:info.uuid},
        success: function (data) {
				$.ligerDialog.success(data.message,'信息',function(){
		    		form2.setData(data.data);
			    });
        },
        error: function (message) {
       	 	$.ligerDialog.error("反审核失败");
        }
    });
}
//不可编辑字段
function setBillEnable(){
	//form2.setEnabled(["createUser","createDate","submitUser","submitDate","auditUser","auditDate","alterUser","alterDate","status"],false); 
}

//收款
function receipt(){
	var info = form2.getData();
	if(validationReceipt($.ligerDialog,info.status)){
		return;
	};
	var uuid = info.uuid;
    $.ligerDialog.open({
    	title:'收款',
    	url: '/receipt/alterReceipt?parentId='+uuid,
    	height: 500,
    	width:900,
    	isResize: true
    });
}
//附件
function formfile(){
	var info = form2.getData();
	var uuid = info.uuid;
	if(uuid == null){
		$.ligerDialog.error("请先保存数据");
		return;
	}
	
    $.ligerDialog.open({
    	title:'附件管理',
    	url: '/formFile/toFormFile?resourceId='+uuid,
    	height: 500,
    	width:900,
    	isResize: true,
    	 success: function (data) {
				$.ligerDialog.success(data.message,'信息',function(){
			    });
	     },
	     error: function (message) {
	    	 	$.ligerDialog.error("上传失败");
	     }
    });
}
//打印
var LODOP; //声明为全局变量   

function print(){
	CreateFullBill();
  	LODOP.PREVIEW();
}

function CreateFullBill() {
	LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));  
	LODOP.PRINT_INITA(10,10,762,533,"打印控件功能演示_Lodop功能_移动公司发票全样");
	LODOP.SET_PRINT_STYLE("FontColor","#0000FF");
	LODOP.ADD_PRINT_SHAPE(2,116,43,655,373,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(1,144,44,653,1,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(1,172,44,653,1,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,116,143,1,56,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,116,488,1,56,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,116,574,1,372,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,172,166,1,282,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,172,415,1,282,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(1,454,44,653,1,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,454,130,1,34,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,454,483,1,34,0,1,"#800000");
	LODOP.ADD_PRINT_SHAPE(0,64,62,120,1,0,1,"#0000FF");
	LODOP.ADD_PRINT_SHAPE(3,29,62,32,32,0,4,"#0000FF");
	LODOP.ADD_PRINT_SHAPE(3,21,300,147,75,0,3,"#FF0000");
	LODOP.ADD_PRINT_SHAPE(3,26,307,132,65,0,1,"#FF0000");
	LODOP.ADD_PRINT_TEXT(33,192,408,30,"中国移动通信集团北京有限公司专用发票");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(68,326,100,25,"发 票 联");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(29,98,84,35,"中国移动通信CHINA MOBILE");
	LODOP.ADD_PRINT_SHAPE(2,37,69,18,15,0,1,"#0000FF");
	LODOP.ADD_PRINT_SHAPE(2,40,73,10,9,0,1,"#0000FF");
	LODOP.ADD_PRINT_TEXT(70,64,117,20,"移 动 信 息 专 家");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(124,58,68,20,"客户名称");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(152,58,68,20,"手机号码");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(124,497,68,20,"受理类别");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(152,497,68,20,"合 同 号");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(465,54,68,20,"大写金额");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(465,495,104,20,"小写金额    ￥: ");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(98,56,47,20,"编号：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(98,259,48,20,"日期：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(97,500,71,20,"发票号码：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(496,54,83,20,"话费帐期：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(496,321,83,20,"营业员工号：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(496,480,93,20,"收款单位名称：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(226,703,27,121,"第二联发票联");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(203,21,17,195,"京地税准印八九号五百万份");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
	LODOP.ADD_PRINT_TEXT(126,150,100,20,"郭德强");
	LODOP.ADD_PRINT_TEXT(151,150,100,20,"13954885188");
	LODOP.ADD_PRINT_TEXT(125,584,99,20,"发票打印(第1次)");
	LODOP.ADD_PRINT_TEXT(465,140,198,20,"陆百柒拾捌元叁角零分");
	LODOP.ADD_PRINT_TEXT(465,599,70,20,"678.30");
	LODOP.ADD_PRINT_TEXT(496,408,59,20,"H112063");
	LODOP.ADD_PRINT_TEXT(191,58,100,20,"国内漫游通话");
	LODOP.ADD_PRINT_TEXT(191,217,100,20,"584.00");
	LODOP.ADD_PRINT_TEXT(222,58,100,20,"增值业务费");
	LODOP.ADD_PRINT_TEXT(222,217,100,20,"48.30");
	LODOP.ADD_PRINT_TEXT(251,58,100,20,"代收费");
	LODOP.ADD_PRINT_TEXT(251,217,100,20,"50.00");
	LODOP.ADD_PRINT_TEXT(280,58,100,20,"优惠费");
	LODOP.ADD_PRINT_TEXT(280,217,100,20,"4.00");
	LODOP.ADD_PRINT_TEXT(98,101,150,20,"101081005747319387");
	LODOP.ADD_PRINT_TEXT(97,307,150,20,"2008年10月19日 10:28:38");
	LODOP.ADD_PRINT_TEXT(152,584,103,20,"138860016786");
	LODOP.ADD_PRINT_TEXT(95,571,112,20,"06775516");
	LODOP.SET_PRINT_STYLEA(0,"FontName","System");
	LODOP.ADD_PRINT_TEXT(76,500,71,20,"发票代码：");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#800000");
	LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
	LODOP.ADD_PRINT_TEXT(74,571,112,20,"237090742401");
	LODOP.SET_PRINT_STYLEA(0,"FontName","System");
	LODOP.SET_PRINT_STYLEA(0,"FontColor","#FF0000");
	LODOP.ADD_PRINT_TEXT(496,135,183,20,"2008年09月(20080901-20080930)");
	LODOP.ADD_PRINT_TEXT(496,572,112,20,"-王府井中心店营");
	LODOP.ADD_PRINT_TEXT(311,217,100,20,"678.30");
	LODOP.ADD_PRINT_TEXT(311,58,100,20,"费用合计");
};	

</script>
</html>